﻿UPDATE Topic SET PostCount = counted FROM Topic T INNER JOIN (SELECT (COUNT(*) - 1) AS counted, Topic_id FROM Post GROUP BY Topic_id) P ON T.Id = P.Topic_Id
